package com.michale.common.codemessage;

/**
 * @author Michale
 * @apiNote 业务状态码和状态信息
 */
public enum ServiceCodeMessage {

    /**
     * 10: 登录状态信息
     */
    LOGIN_SUCCESSFUL(10000, "登录-成功"),
    LOGIN_FAIL(10001, "登陆失败-失败"),
    /**
     * 20: 小区列表状态信息
     */
    COMMUNITY_SEARCH_SUCCESS(20000, "查询小区列表信息-成功"),
    COMMUNITY_SEARCH_FAIL(20001, "查询小区列表信息-失败"),

    COMMUNITY_ADD_SUCCESS(20010, "新增小区信息-成功"),
    COMMUNITY_ADD_FAIL(20011, "新增小区信息-失败"),

    COMMUNITY_UPDATE_SUCCESS(20020, "修改小区信息-成功"),
    COMMUNITY_UPDATE_FAIL(20021, "修改小区信息-失败"),

    COMMUNITY_DELETE_SUCCESS(20030, "删除小区信息-成功"),
    COMMUNITY_DELETE_FAIL(20031, "删除小区信息-失败"),

    COMMUNITY_PIC_UPLOAD_SUCCESS(20040, "小区缩略图上传-成功"),
    COMMUNITY_PIC_UPLOAD_FAIL(20041, "小区缩略图上传-失败"),

    COMMUNITY_PIC_DEL_SUCCESS(20050, "小区缩略图删除-成功"),
    COMMUNITY_PIC_DEL_FAIL(20051, "小区缩略图删除-失败"),

    COMMUNITY_FIND_BY_ID_SUCCESS(20060, "根据主键获取小区对象-成功"),
    COMMUNITY_FIND_BY_ID_FAIL(20061, "根据主键获取小区对象-失败"),

    COMMUNITY_UPDATE_STATUS_SUCCESS(20070, "小区状态信息更新-成功"),
    COMMUNITY_UPDATE_STATUS_FAIL(20071, "小区状态信息更新-失败");


    private final String message;
    private final int code;

    ServiceCodeMessage(int code, String message) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public int getCode() {
        return code;
    }
}
